# 项目常量定义
import os
# 默认配置
IS_CAPCUT_ENV = False
IS_UPLOAD_DRAFT = True
# 接口文档
ENABLE_DOCS = True
ENABLE_REDOC = False
# 确保路径使用正确的操作系统分隔符
DRAFT_DIR = "E:\\jianying\\JianyingPro Drafts"
DRAFT_URL = "https://capcut.yyzc.net.cn"
DRAFT_PREVIEW_URL = "/draft/downloader"
SYSTEM_FFMPEG_PATH = "E:\\ai_detect\\ffmpeg\\bin\\ffmpeg.exe"
SYSTEM_FFPROBE_PATH = "E:\\ai_detect\\ffmpeg\\bin\\ffprobe.exe"
# REDIS配置
REDIS_CONFIG = {
    "host": "localhost",
    "port": 6379,
    "db": 0,
    "password": None,
    "decode_responses": False
}

# Huey配置
HUEY_CONFIG = {
    "name": "capcut-tasks",  # 队列名称
    "utc": False,           # 是否使用UTC时间
    "connection_pool": None,
    **REDIS_CONFIG  # 解包REDIS_CONFIG的所有配置
}

Ali_OSS_CONFIG = {
    'bucket_name': 'dji-storage-dt',
    'access_key_id': '',
    'access_key_secret': '',
    'endpoint': 'https://oss-cn-shanghai.aliyuncs.com',
    'host': 'dji-storage-dt.oss-cn-shanghai.aliyuncs.com'  # 添加host配置
}

# 数据库配置
DATABASE_TYPE = "sqlite"  # sqlite 或 mysql
DATABASE_URL = None  # 如果为None，将使用默认配置
DATABASE_ECHO = True  # 是否打印SQL语句

# MySQL配置示例（当DATABASE_TYPE为mysql时使用）
# DATABASE_URL = "mysql+pymysql://username:password@localhost:3306/capcut_api"

# JWT配置
JWT_SECRET_KEY = "your-secret-key-here"  # 生产环境请使用环境变量
JWT_ALGORITHM = "HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES = 30 * 24 * 60  # 30天
JWT_HEADER_NAME = "x-api-key"  # 自定义JWT头字段名
JWT_WHITE_LIST = [
    # 健康检查
    "/health/health_check",
    # API文档
    "/docs",
    "/redoc", 
    "/openapi.json",
    # 用户认证相关（无需token）
    "/user/register",
    "/user/login",
    # 其他白名单路径
    "/favicon.ico"
]
